// JavaScript Document
function obj(){
	td = navigator.appName;
	if(td == "Microsoft Internet Explorer"){
		dd = new ActiveXObject("Microsoft.XMLHTTP");	
	}else{
		dd = new XMLHttpRequest();	
	}
	return dd;
}

http = obj();
function loadXMLHocVienDanhSachLop(malophoc){
	url = "hocvien_danhsachlop.php?mlh="+malophoc;
	http.open("get",url,true);
	http.onreadystatechange=process;
	http.send(null);
};
function loadXMLHopDong(keyword, page){
	url = "hopdong_danhsach.php?key="+keyword+"&pag="+page;
	http.open("get",url,true);
	http.onreadystatechange=process;
	http.send(null);
}
function loadXMLNguoiDung(keyword, page){
	url = "nguoidung_danhsach.php?key="+keyword+"&pag="+page;
	http.open("get",url,true);
	http.onreadystatechange=process;
	http.send(null);
}

function loadXMLTTLop(malophoc){
	url = "xeplop_thongtinlop.php?mlh="+malophoc;
	http.open("get",url,true);
	http.onreadystatechange=process2;
	http.send(null);
}
function loadXMLGiaoVien(keyword, page){
	url = "giaovien_danhsach.php?key="+keyword+"&pag="+page;
	http.open("get",url,true);
	http.onreadystatechange=process;
	http.send(null);
}
function loadXMLHVDaXoa(keyword, page){
	url = "hocvien_daxoa_danhsach.php?key="+keyword+"&pag="+page;
	http.open("get",url,true);
	http.onreadystatechange=process;
	http.send(null);
}
function loadXMLHoaDon(mnd, courses, keyword, page){
	url = "hoadon_danhsach_paging.php?mnd="+mnd+"&cou="+courses+"&key="+keyword+"&pag="+page;
	http.open("get",url,true);
	http.onreadystatechange=process;
	http.send(null);
}
function loadXMLXepLop(key, mathoigian, machuongtrinh, makhoahoc, page){
	url = "hocvien_xeplop_ajax1.php?key="+key+"&mtgh="+mathoigian+"&mkh="+makhoahoc+"&mct="+machuongtrinh+"&pag="+page;
	http.open("get",url,true);
	http.onreadystatechange=process;
	http.send(null);
}
function loadXMLDoc(status, keyword, page){
	url = "hocvien_timkiem.php?sta="+status+"&key="+keyword+"&pag="+page;
	http.open("get",url,true);
	http.onreadystatechange=process;
	http.send(null);	
}
function loadXMLDoc2(keyword, page){
	url = "hocphi_phaithu_hv.php?key="+keyword+"&pag="+page;
	http.open("get",url,true);
	http.onreadystatechange=process;
	http.send(null);	
}
function loadXMLBangLuong(makhoa, keyword, page){
	url = "bangluong_danhsach.php?mkh="+makhoa+"&key="+keyword+"&pag="+page;
	http.open("get",url,true);
	http.onreadystatechange=process;
	http.send(null);	
}
function process(){
	if(http.readyState == 4 && http.status == 200){
		document.getElementById("result").innerHTML = http.responseText;	
	}
}
function process2(){
	if(http.readyState == 4 && http.status == 200){
		document.getElementById("result2").innerHTML = http.responseText;	
	}
}